package com.yuanian.timingwheel.facade;

import com.yuanian.timingwheel.model.task.base.BaseTask;
import com.yuanian.timingwheel.model.timingwheel.DayTimingWheel;

/**
 * 时间轮管理器，所有操作的入口
 */
public class TwManager {

    private static TwManager twManager = new TwManager();

    private DayTimingWheel dayTimingWheel;

    private TwManager() {
        dayTimingWheel = new DayTimingWheel();
    }

    public static TwManager getInstance() {
        return twManager;
    }

    /**
     * 启动时间轮
     */
    public void start() {
        dayTimingWheel.start();
    }

    /**
     * 暂停时间轮
     */
    public void suspend() {
        dayTimingWheel.suspend();
    }

    /**
     * 恢复时间轮
     */
    public void resume() {
        dayTimingWheel.resume();
    }

    /**
     * 关闭时间轮
     */
    public void shutdown() {
        dayTimingWheel.shutdown();
    }



    /**
     * 新增任务
     * @param task
     */
    public void addTask(BaseTask task) {
        dayTimingWheel.addTask(task);
    }

    /**
     * 删除任务
     */
    public void deleteTask() {

    }

    /**
     * 修改任务
     */
    public void updateTask() {

    }

    /**
     * 恢复任务
     */
    public void consumeTask() {

    }

    /**
     * 暂停任务
     */
    public void suspendTask() {

    }

}
